package net.kleinhenz.norabase.server;

import java.io.IOException;
import java.util.Map;

import net.kleinhenz.norabase.client.RuneService;
import net.kleinhenz.norabase.shared.model.Champion;
import net.kleinhenz.norabase.shared.model.Equipment;
import net.kleinhenz.norabase.shared.model.Relic;
import net.kleinhenz.norabase.shared.model.Spell;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class RuneServiceImpl extends RemoteServiceServlet implements RuneService {

	private static final long serialVersionUID = 1L;

	@Override
	public Champion fetchChampion(int id) {		
		return PoxNoraXMLReader.getChampion(id);
	}

	@Override
	public Spell fetchSpell(int id) {		
		return PoxNoraXMLReader.getSpell(id);
	}

	@Override
	public Equipment fetchEquipment(int id) {		
		return PoxNoraXMLReader.getEquipment(id);
	}

	@Override
	public Relic fetchRelic(int id) {		
		return PoxNoraXMLReader.getRelic(id);
	}

	@Override
	public Map<String, Integer> fetchSonyMap() {
		try {
			return CSVReader.getSonyMap();
		} catch (IOException e) {
			throw new RuntimeException();
		}
	}
}
